package com.luo.backend.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.luo.backend.entity.Review;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 评价响应DTO
 */
public class ReviewResponse {
    
    private Long id;
    private Long orderId;
    private String orderNo;
    private Long userId;
    private String username;
    private String realName;        // ✅ 新增：用户真实姓名
    private String userAvatar;
    private Long merchantId;
    private String merchantName;
    private String merchantLogo;
    private Long foodId;
    private String foodName;
    private String foodImage;
    private Integer overallRating;      // 综合评分
    private Integer tasteRating;        // 口味评分
    private Integer speedRating;        // 速度评分
    private Integer packageRating;      // 包装评分
    private String content;             // 评价内容
    private List<String> images;        // 图片数组
    private List<String> tags;          // 标签数组
    private String merchantReply;       // 商家回复
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime merchantReplyAt;  // 商家回复时间
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    
    // 构造函数
    public ReviewResponse() {}
    
    public ReviewResponse(Review review) {
        this.id = review.getId();
        this.orderId = review.getOrderId();
        this.userId = review.getUserId();
        this.merchantId = review.getMerchantId();
        this.foodId = review.getFoodId();
        this.overallRating = review.getOverallRating();
        this.tasteRating = review.getTasteRating();
        this.speedRating = review.getSpeedRating();
        this.packageRating = review.getPackageRating();
        this.content = review.getContent();
        this.images = review.getImages();
        this.tags = review.getTags();
        this.merchantReply = review.getMerchantReply();
        this.merchantReplyAt = review.getMerchantReplyAt();
        this.createdAt = review.getCreatedAt();
        this.updatedAt = review.getUpdatedAt();
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getOrderId() {
        return orderId;
    }
    
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }
    
    public String getOrderNo() {
        return orderNo;
    }
    
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getRealName() {
        return realName;
    }
    
    public void setRealName(String realName) {
        this.realName = realName;
    }
    
    public String getUserAvatar() {
        return userAvatar;
    }
    
    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }
    
    public Long getMerchantId() {
        return merchantId;
    }
    
    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }
    
    public String getMerchantName() {
        return merchantName;
    }
    
    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }
    
    public String getMerchantLogo() {
        return merchantLogo;
    }
    
    public void setMerchantLogo(String merchantLogo) {
        this.merchantLogo = merchantLogo;
    }
    
    public Long getFoodId() {
        return foodId;
    }
    
    public void setFoodId(Long foodId) {
        this.foodId = foodId;
    }
    
    public String getFoodName() {
        return foodName;
    }
    
    public void setFoodName(String foodName) {
        this.foodName = foodName;
    }
    
    public String getFoodImage() {
        return foodImage;
    }
    
    public void setFoodImage(String foodImage) {
        this.foodImage = foodImage;
    }
    
    public Integer getOverallRating() {
        return overallRating;
    }
    
    public void setOverallRating(Integer overallRating) {
        this.overallRating = overallRating;
    }
    
    public Integer getTasteRating() {
        return tasteRating;
    }
    
    public void setTasteRating(Integer tasteRating) {
        this.tasteRating = tasteRating;
    }
    
    public Integer getSpeedRating() {
        return speedRating;
    }
    
    public void setSpeedRating(Integer speedRating) {
        this.speedRating = speedRating;
    }
    
    public Integer getPackageRating() {
        return packageRating;
    }
    
    public void setPackageRating(Integer packageRating) {
        this.packageRating = packageRating;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public List<String> getImages() {
        return images;
    }
    
    public void setImages(List<String> images) {
        this.images = images;
    }
    
    public List<String> getTags() {
        return tags;
    }
    
    public void setTags(List<String> tags) {
        this.tags = tags;
    }
    
    public String getMerchantReply() {
        return merchantReply;
    }
    
    public void setMerchantReply(String merchantReply) {
        this.merchantReply = merchantReply;
    }
    
    public LocalDateTime getMerchantReplyAt() {
        return merchantReplyAt;
    }
    
    public void setMerchantReplyAt(LocalDateTime merchantReplyAt) {
        this.merchantReplyAt = merchantReplyAt;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}
